<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Login</title>
</head>
<body>
<div id="login">
    <h1>登录页面</h1>
    <form method="POST">   <!-- method 方法 post -->
        {% csrf_token %}
        <!--  {{ csrf_token }} 是防止网站被跨域攻击的 -->
        <p><input type="text" placeholder="账号" name="username" id="username"></br></p>
        <p><input type="password" placeholder="密码" name="password" id="password"></br></p>
        <p><input type="submit" name="登录" id="submit" value="登录"></br></p>
        <p class="text-danger text-center" style="color:#e75252">{{ error }}</p>
        <p><a href="regist/">注册账户</a></br></p>
    </form>


</div>
</body>
</html>
<style>
    body, p, div, ul, li, h1, h2, h3, h4, h5, h6 {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }


    body {
        background: #E9E9E9;
    }

    #login {
        width: 25%;
        height: 300px;
        background: #FFF;
        margin: 200px auto;
        position: relative;
    }

    #login h1 {
        text-align: center;
        position: absolute;
        left: 131px;
        top: -50px;
        /*font-size: 21px;*/
    }

    #login form p {
        text-align: center;
    }

    #username {
        background: rgba(0, 0, 0, .1) no-repeat;
        width: 200px;
        height: 30px;
        border: solid #ccc 1px;
        border-radius: 3px;
        padding-left: 32px;
        margin-top: 50px;
        margin-bottom: 30px;
    }

    #password {
        background: rgba(0, 0, 0, .1) no-repeat;
        width: 200px;
        height: 30px;
        border: solid #ccc 1px;
        border-radius: 3px;
        padding-left: 32px;
        margin-bottom: 30px;
    }

    #submit {
        width: 116px;
        height: 30px;
        background: rgba(0, 0, 0, .1);
        border: solid #ccc 1px;
        border-radius: 3px;
    }

    #submit:hover {
        cursor: pointer;
        background: #D8D8D8;
    }
</style>
